<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery-1.12.4.min.js" type="text/javascript" ></script>
</head>
<body>
    <div style="display:flex;justify-content:center;align-items:center;margin: 100px;" >
        <div>请输入</div>
        <input id="input1" type="search" onkeypress="myFunction(event)">
    </div>
</body>
</html>

<script>
    function myFunction(event) {
      var keyword= document.getElementById("input1").value;
      if (event.keyCode === 13) {
        window.open("/demo/books"+"?keyword=0-"+keyword);
      }
    }
</script>